<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('修改防疫人员信息')" />
    <th:block th:include="include :: datetimepicker-css" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-user-edit" th:object="${fyUser}">
            <input name="userId" th:field="*{userId}" type="hidden">
            <div class="form-group">    
                <label class="col-sm-3 control-label">队伍ID：</label>
                <div class="col-sm-8">
                    <select name="teamId" class="form-control m-b" th:with="type=${fyTeams}">
                    	<option value="" >请选择</option>
		                <option th:each="team : ${type}" th:text="${team.teamName}" th:value="${team.teamId}" th:field="*{teamId}"></option>
		            </select>
                </div>
            </div>
            <input id="teamName" name="teamName" th:field="*{teamName}" type="hidden">
            <div class="form-group">    
                <label class="col-sm-3 control-label">姓名：</label>
                <div class="col-sm-8">
                    <input name="userName" th:field="*{userName}" class="form-control" type="text">
                </div>
            </div>
            <!-- <div class="form-group">    
                <label class="col-sm-3 control-label">用户邮箱：</label>
                <div class="col-sm-8">
                    <input name="email" th:field="*{email}" class="form-control" type="text">
                </div>
            </div> -->
            <div class="form-group">    
                <label class="col-sm-3 control-label">身份证号：</label>
                <div class="col-sm-8">
                    <input name="idcard" th:field="*{idcard}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">手机号码：</label>
                <div class="col-sm-8">
                    <input name="phonenumber" th:field="*{phonenumber}" class="form-control" type="text">
                </div>
            </div>
            <!-- <div class="form-group">    
                <label class="col-sm-3 control-label">微信openId：</label>
                <div class="col-sm-8">
                    <input name="openId" th:field="*{openId}" class="form-control" type="text" readonly>
                </div>
            </div> -->
            <div class="form-group">    
                <label class="col-sm-3 control-label">小程序首次绑定时间：</label>
                <div class="col-sm-8">
                    <input name="firstBindingTime" th:field="*{firstBindingTime}" class="form-control" type="text" readonly>
                </div>
            </div>
            <!-- <div class="form-group">    
                <label class="col-sm-3 control-label">头像路径：</label>
                <div class="col-sm-8">
                    <input name="avatar" th:field="*{avatar}" class="form-control" type="text">
                </div>
            </div> -->
            <!-- <div class="form-group">    
                <label class="col-sm-3 control-label">帐号状态：</label>
                <div class="col-sm-8">
                    <div class="radio-box" th:each="dict : ${@dict.getType('sys_normal_disable')}">
                        <input type="radio" th:id="${'status_' + dict.dictCode}" name="status" th:value="${dict.dictValue}" th:field="*{status}">
                        <label th:for="${'status_' + dict.dictCode}" th:text="${dict.dictLabel}"></label>
                    </div>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">最后登录IP：</label>
                <div class="col-sm-8">
                    <input name="loginIp" th:field="*{loginIp}" class="form-control" type="text" readonly>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">最后登录时间：</label>
                <div class="col-sm-8">
                    <div class="input-group date">
                        <input name="loginDate" th:value="${#dates.format(fyUser.loginDate, 'yyyy-MM-dd')}" class="form-control" placeholder="yyyy-MM-dd" type="text" readonly>
                        <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                    </div>
                </div>
            </div> -->
            <div class="form-group">    
                <label class="col-sm-3 control-label">负责统筹单位：</label>
                <div class="col-sm-8">
                    <input name="leadOrg" th:field="*{leadOrg}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">来源单位：</label>
                <div class="col-sm-8">
                    <input name="fromOrg" th:field="*{fromOrg}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">类别 ：</label>
                <div class="col-sm-8">
                    <select name="userType" class="form-control m-b" th:with="type=${@dict.getType('fym_user_type')}">
                        <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{userType}"></option>
                    </select>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">岗位：</label>
                <div class="col-sm-8">
                    <input name="job" th:field="*{job}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">备注：</label>
                <div class="col-sm-8">
                    <textarea name="remark" class="form-control">[[*{remark}]]</textarea>
                </div>
            </div>
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <th:block th:include="include :: datetimepicker-js" />
    <script th:inline="javascript">
        var prefix = ctx + "fym/user";
        $("#form-user-edit").validate({
            focusCleanup: true
        });
      //下拉框改变的时候id变化的同时，name也跟着变
        $('#teamId').change(function(){
        	//console.log($("#placeId option:selected").text());
        	$("#teamName").val($("#teamId option:selected").text());
        })
        function submitHandler() {
            if ($.validate.form()) {
                $.operate.save(prefix + "/edit", $('#form-user-edit').serialize());
            }
         // 父页面的方法
			activeWindow().timeoutQueryUserTree(); 
			$.modal.close();
        }

        $("input[name='loginDate']").datetimepicker({
            format: "yyyy-mm-dd",
            minView: "month",
            autoclose: true
        });
    </script>
</body>
</html>